rev[s_List] := If[s == {}, {}, Append[rev[Rest[s]], First[s]]]

rev[{1, 2, 3, 4, 5, 6}]

tr = Trace[rev[{1, 2, 3, 4}], Append]

\(minimum[s_List] := 
	
      Which[s == {}, Infinity, 
		\ \ \ \ \ \ \ \ \ \ \ \ Length[s] == 1, 
        s[\([1]\)], 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        s[\([1]\)]\  > \ s[\([2]\)], \ minimum[Drop[s, {1}]], 

        \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ True, \ minimum[Drop[s, {2}]]]\)

minimum[{9, 3, 7, 5, 8, 5, 2, 1, 7, 4, 9, 6}]

\(merge[a_List, \ b_List] := 
	
      Which[a == {}, b, 
		\ \ \ \ \ \ \ \ \ \ \ \ b == {}, \ a, 

        		\ \ \ \ \ \ \ \ \ \ \ \ a[\([1]\)]\  < \ b[\([1]\)], \ 
        Prepend[merge[Rest[a], \ b], \ a[\([1]\)]], 

        		\ \ \ \ \ \ \ \ \ \ \ \ True, \ 
        Prepend[merge[Rest[b], \ a], \ b[\([1]\)]]\ ]\)

merge[{1, 3, 5, 7, 9},  {2, 4, 6, 8}]

\(mergesort[s_List] := 
	
      Switch[Length[s], 
	\ \ \ \ 0, {}, 
	\ \ \ \ 1, \ s, 
	\ \ \ \ _, 
        \ With[{m = Quotient[Length[s], \ 2]}, 

          	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
          merge[mergesort[Take[s, \ m]], 

            	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ mergesort[Drop[s, m]]]]]\)

mergesort[{9, 3, 5, 6, 8, 1, 2, 6, 5, 3}]

data = Table[Random[Integer,  {1, 200}],  {25}]

mergesort[data]